import request from './request.js'

// 根据IP地址查询所在城市接口
export const getLocalCityData = () => {
    return request({
        method: 'get',
      //url: '/ip?ip=114.247.50.2&key=<用户的 key>',
      //参数1 ip地址 可选 (若不填 则默认取 http 本地 ip)
      //参数2 高德key必填
        url: '/ip?key=1d03d4f102a2c5659e0caa4c6ebdb8ac',
    })
}
// 根据城市查询adcode接口
export const getCityAdcodeData = (city) => {
    return request({
        method: 'get',
        url: `/geocode/geo?address=${city}&key=1d03d4f102a2c5659e0caa4c6ebdb8ac`,
    })
}
// 根据adcode查询城市天气接口
export const getCityWeatherData = (adcode,extensions) => {
    return request({
        method: 'get',
        url: `/weather/weatherInfo?city=${adcode}&key=1d03d4f102a2c5659e0caa4c6ebdb8ac&extensions=${extensions}`,
    })
}

//关键字查询城市接口
export const getCityNameData = (value) => {
    return request({
        method: 'get',
        url: `/config/district?keywords=${value}&subdistrict=0&key=1d03d4f102a2c5659e0caa4c6ebdb8ac`,
    })
}